package com.Test1.Test2;

public class test2 {
    public static void feedPet(pet pet){
        Master master = new Master();
        pet cat = new Cat();
        pet dog = new Dog();
        Fish fish = new Fish("鱼");
        Bone bone = new Bone("骨头");
        master.feed(cat, fish);
        master.feed(dog, bone);
    }

    public static void main(String[] args) {
        Master master = new Master(); // 实例化两只宠物
         pet cat = new Cat();
         pet dog = new Dog();
        // 两份食物
         Fish fish = new Fish("鱼");
         Bone bone = new Bone("骨头");
        // 分别喂养
         master.feed(cat, fish);
         master.feed(dog, bone);
        Dog dog1 = new Dog();
        Cat cat1 = new Cat();
        cat1.huntMice();
        dog1.guardEntrance();



    }
}
